# 输入一个 rendered 自动填充组内所有节点

# 相减
scoreboard players set fork_rendered mt_index 3
scoreboard players operation fork_rendered mt_index *= rendered mt_index

scoreboard players operation @e[tag=mt_gen_last] mt_index -= rendered mt_index
scoreboard players operation @e[tag=mt_gen] mt_index -= fork_rendered mt_index

# 打上花火(?)
tag @e[scores={mt_index=0},tag=mt_gen_last,limit=1] add mt_surf_fill_in1
tag @e[scores={mt_index=1},tag=mt_gen,limit=1] add mt_surf_fill_in2

tag @e[scores={mt_index=0},tag=mt_gen,limit=1] add mt_surf_fill_in3
function mountain:surf_fill/entry
tag @e[tag=mt_surf_fill_in3] remove mt_surf_fill_in3

tag @e[scores={mt_index=2},tag=mt_gen,limit=1] add mt_surf_fill_in3
function mountain:surf_fill/entry
tag @e[tag=mt_surf_fill_in3] remove mt_surf_fill_in3

tag @e[tag=mt_surf_fill_in1] remove mt_surf_fill_in1
tag @e[tag=mt_surf_fill_in2] remove mt_surf_fill_in2

scoreboard players operation @e[tag=mt_gen_last] mt_index += rendered mt_index
scoreboard players operation @e[tag=mt_gen] mt_index += fork_rendered mt_index